package com.huike.web.controller.report;


import com.huike.business.domain.TbBusiness;
import com.huike.clues.domain.TbClue;
import com.huike.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/index")
public class IndexController {
    @GetMapping(value = "")
    public AjaxResult getInfo( String beginCreateTime, String endCreateTime) {
        Map<String, Integer> data = new HashMap<>();
        data.put("cluesNum",1);
        data.put("businessNum",2);
        data.put("contractNum",3);
        data.put("salesAmount",4);
        data.put("todayCluesNum",5);
        data.put("todayBusinessNum",6);
        data.put("todayContractNum",7);
        data.put("todaySalesAmount",8);
        data.put("tofollowedCluesNum",9);
        data.put("tofollowedBusinessNum",10);
        data.put("toallocatedCluesNum",11);
        data.put("toallocatedBusinessNum",12);

        return AjaxResult.success( data);
    }

    @GetMapping(value = "/businessChangeStatistics")
    public AjaxResult getInfo1( String beginCreateTime, String endCreateTime) {


        List<Map<String,Object>>  data = new ArrayList<>();
        for (int i = 0; i <2 ; i++) {
            Map<String,Object> map = new HashMap<>();
            map.put("create_by","张三" + i);
            map.put("deptName","部门" + i);
            map.put("num","线索转化数" + i);
            map.put("radio","线索转化率" + i);
            data.add(map);
        }

        return AjaxResult.success( data);
    }


    @GetMapping(value = "/salesStatistic")
    public AjaxResult salesStatistic( String beginCreateTime, String endCreateTime) {
        List<Map<String,Object>>  data = new ArrayList<>();
        for (int i = 0; i <2 ; i++) {
            Map<String,Object> map = new HashMap<>();
            map.put("create_by","李四" + i);
            map.put("deptName","部门" + i);
            map.put("num","线索转化数" + i);
            map.put("radio","线索转化率" + i);
            data.add(map);
        }

        return AjaxResult.success( data);
    }

}
